﻿using System;
using System.Collections.Generic;
using Viettel.VOFFICE.DAO.Models;

namespace Viettel.VOFFICE.DAO.DAL.Repository
{
    /// <summary>
    /// xử lý vết đi của luồng
    /// </summary>
    public class TraceFlowRepository : IRepository<TraceFlow>
    {
        private VOFFICEContext context;

        public TraceFlowRepository(VOFFICEContext context)
        {
            if (context == null)
            {
                throw new Exception("Context must be init");
            }
            this.context = context;
        }
        public IEnumerable<TraceFlow> Get()
        {
            throw new NotImplementedException();
        }

        public TraceFlow GetById(object id)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<TraceFlow> FindByName(object s)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="T"></param>
        public void Insert(TraceFlow T)
        {
            if (null != T)
            {
                context.TraceFlows.Add(T);
                Save();
            }
        }

        public void Delete(object id)
        {
            throw new NotImplementedException();
        }

        public void Delete(TraceFlow T)
        {
            throw new NotImplementedException();
        }

        public void Update(TraceFlow T)
        {
            throw new NotImplementedException();
        }

        public void Save()
        {
            context.SaveChanges();
        }
    }
}
